package com.mzw.huaxiarealestatebackend.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * (Staff)实体类
 *
 * @author makejava
 * @since 2023-12-11 16:21:55
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("staff")
public class Staff implements Serializable {
    private static final long serialVersionUID = 522335790551266593L;

    @TableId
    private String stfNo;

    private String dpNo;

    private String stfName;

    private String stfSex;

    private String stfIdno;

    private String stfTel;

    private String stfQq;

    private String stfEmail;

    private String stfLocation;

    private String stfLevel;

    private String stfCardno;

    private String stfStatus;

    @TableField(exist = false)
    private String dpName;

    @TableField(exist = false)
    private String stfLevelName;

    @TableField(exist = false)
    private String stfStatusName;

    /**
     * 对应部门名称，职位名称，员工状态
     */
    public void resetName(){
        if (this.dpNo.equals("1")){
            this.setDpName("前台");
        } else if (this.dpNo.equals("2")) {
            this.setDpName("建模部门");
        }else if (this.dpNo.equals("3")){
            this.setDpName("渲染部门");
        }else if (this.dpNo.equals("4")){
            this.setDpName("后期部门");
        }
        if (this.stfLevel.equals("1")){
            this.setStfLevelName("主管");
        }else if(this.stfLevel.equals("2")){
            this.setStfLevelName("老手");
        } else if (this.stfLevel.equals("3")) {
            this.setStfLevelName("新手");
        }else {
            this.setStfLevelName("普通员工");
        }
        if (this.getStfStatus().equals("0")){
            this.setStfStatusName("离职");
        }else {
            this.setStfStatusName("在职");
        }
    }

}

